home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 008 / src / hack.rip.c < prev    next >
C/C++ Source or Header  |  1995-03-17  |  2KB  |  87 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984. */
  2.  
  3. #include <stdio.h>
  4. #include "hack.h"
  5. /* #include   <libraries/dos.h> */
  6.  
  7. extern char plname[];
  8.  
  9. static char *rip[] = {
  10. "                       ----------",
  11. "                      /          \\",
  12. "                     /    REST    \\",
  13. "                    /      IN      \\",
  14. "                   /     PEACE      \\",
  15. "                  /                  \\",
  16. "                  |                  |",
  17. "                  |                  |",
  18. "                  |                  |",
  19. "                  |                  |",
  20. "                  |                  |",
  21. "                  |       1001       |",
  22. "                 *|     *  *  *      | *",
  23. "        _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______\n",
  24. 0
  25. };
  26.  
  27. outrip(){
  28.    register char **dp = rip;
  29.    register char *dpx;
  30. /*   struct DateStamp now, *DateStamp(); */
  31.    char buf[BUFSZ];
  32.    register int x,y;
  33.    int thisyear;
  34.  
  35.    cls();
  36.  
  37. /*   now = DateStamp(&now);  */
  38.    thisyear = 85;
  39.    (void) strcpy(buf, plname);
  40.    buf[16] = 0;
  41.    center(6, buf);
  42.    (void) sprintf(buf, "%ld AU", u.ugold);
  43.    center(7, buf);
  44.    (void) sprintf(buf, "killed by%s",
  45.       !strncmp(killer, "the ", 4) ? "" :
  46.       !strcmp(killer, "starvation") ? "" :
  47.       index(vowels, *killer) ? " an" : " a");
  48.    center(8, buf);
  49.    (void) strcpy(buf, killer);
  50.    if(strlen(buf) > 16) {
  51.        register int i,i0,i1;
  52.       i0 = i1 = 0;
  53.       for(i = 0; i <= 16; i++)
  54.          if(buf[i] == ' ') i0 = i, i1 = i+1;
  55.       if(!i0) i0 = i1 = 16;
  56.       buf[i1 + 16] = 0;
  57.       center(10, buf+i1);
  58.       buf[i0] = 0;
  59.    }
  60.    center(9, buf);
  61.    (void) sprintf(buf, "19%2d", thisyear);
  62.    center(11, buf);
  63.    for(y=8; *dp; y++,dp++){
  64.       x = 0;
  65.       dpx = *dp;
  66.       while(dpx[x]) {
  67.          while(dpx[x] == ' ') x++;
  68.          curs(x,y);
  69.          while(dpx[x] && dpx[x] != ' '){
  70.             extern int done_stopprint;
  71.             if(done_stopprint)
  72.                return;
  73.             curx++;
  74.             (void) myputchar(dpx[x++]);
  75.          }
  76.       }
  77.    }
  78.    getret();
  79. }
  80.  
  81. center(line, text) int line; char *text; {
  82. register char *ip,*op;
  83.    ip = text;
  84.    op = &rip[line][28 - ((strlen(text)+1)/2)];
  85.    while(*ip) *op++ = *ip++;
  86. }
  87.